package cn.edu.ctbu.demo1.repository;

import cn.edu.ctbu.demo1.domain.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;


import java.util.List;

//参数1: 处理的实体 参数2:处理实体类的主键类型
public interface TeacherRepository extends JpaRepository <Teacher,Integer>{
    /**
     *按姓名查询
     * @param name
     * @return
     */

    List<Teacher> findByNameLike(String name);
    /**
     *按姓名和密码查询
     * @param name
     * @return
     */
    List<Teacher> findByNameAndPassword(String name,String password);

    Page<Teacher> findAll(Pageable pageable);
    List<Teacher> findByNoAndPassword(String no,String password);
}
